import request from '@/utils/request'

// 查询退费单列表
export function listRefund(query) {
  return request({
    url: '/shop/refund/list',
    method: 'get',
    params: query
  })
}

// 查询退费单详细
export function getRefund(id) {
  return request({
    url: '/shop/refund/' + id,
    method: 'get'
  })
}

// 新增退费单
export function addRefund(data) {
  return request({
    url: '/shop/refund',
    method: 'post',
    data: data
  })
}

// 修改退费单
export function updateRefund(data) {
  return request({
    url: '/shop/refund',
    method: 'put',
    data: data
  })
}

// 删除退费单
export function delRefund(id) {
  return request({
    url: '/shop/refund/' + id,
    method: 'delete'
  })
}

// 同意退费
export function agreeRefund(data) {
  return request({
    url: '/shop/refund/agree',
    method: 'put',
    data: data
  })
}


// 拒绝退费
export function refuseRefund(data) {
  return request({
    url: '/shop/refund/refuse',
    method: 'put',
    data: data
  })
}


// 刷新退费单状态
export function refreshRefund(id) {
  return request({
    url: '/shop/refund/refresh/' + id,
    method: 'get'
  })
}
